Majority of substances can find themselves at different temperatures in different aggregations.
If we cool water (liquid) enough, it passes into a solid state (ice), but if we warm it enough, it passes into gas (steam).
The reason for these phenomena are intermolecular forces in a substance. In gas the molecules move quickly and are wide apart from each other, therefore the intermolecular forces remain expressionless. When we cool gas the velocity of molecules reduces, and for this reason the distance between molecules is also reduced. On a smaller distance intermolecular (attracting) forces, which link gas into liquid, become obvious. If we take into consideration also the exterior force of gravity, we notice that a surface is created on liquids.
In liquid the molecules can always move freely. When liquid is cooled further more, the intermolecular distances become short enough so that the intermolecular forces prevail and bind molecules strongly together which from that point on can not move freely. This is how we get a solid body.